<?php

	// creates or/and open the database
	$handler = sqlite_open("timemanagement.db", 0666, $error);
	
	// exception handling
	if(!$handler) die($error);
	
	echo "Create Database successful!";
	
	// CREATE TABLE statement
	$stm = "CREATE TABLE users(username TEXT PRIMARY KEY, password TEXT, email TEXT)";
	
	// save true on success or false on failure to check variable
	$check = sqlite_exec($handler, $stm, $error);
	
	// if false the script will stop 
	if(!$check)
		die("Cannot execute statement: $error");
		
	// close database
	sqlite_close($handler);
	